<ion-view title="{{vm.entrustTitle}}" hide-nav-bar="true">
    <div class="bar bar-header" style="padding: 0;height: 58px;">
        <div class="row" style="position: absolute;">
            <div class="col col-center exhortaions-btn" ng-class="{true: 'active'}[vm.isUnsolved]" ng-click="changeStatus(true)">
                <label>待办列表</label>
            </div>
            <div class="col col-center exhortaions-btn" ng-class="{false: 'active'}[vm.isUnsolved]" ng-click="changeStatus(false)">
                <label>已办列表</label>
            </div>
        </div>
    </div>
    <ion-content class="has-header has-footer" scroll="false" overflow-scroll="true">
        <div class="container">
            <div class="content">
                <div ng-show="vm.isUnsolved">
                    <ion-scroll direction="y" on-scroll="scrollFun()" delegate-handle="pageScroll" style="width: 100%;height: 100%;position: fixed;">
                        <div class="card" style="position: relative;overflow: hidden;" ng-repeat="item in vm.unsolvedExhortaions track by $index" ui-sref="entrust.entrustInfo({entrustId:item.id})">
                            <div class="entrust-import-stat" ng-show="item.importantState === 'true'">重要</div>
                            <div class="item">
                                <div class="row">
                                    <div class="col col-90">
                                        <div ng-if="item.entrustType == 'audio'">
                                            <!--<p class="entrust-type-p">[音频消息]</p>-->
                                            <div class="entrust-content-div">
                                                <div class="data-content audio-content">
                                                    <!--<button ng-click="playAudio(item.entrustAudioPath,item.id)" class="ion ion-play entrust-button-play"></button>-->
                                                    <button class="ion ion-play entrust-button-play"></button>
                                                </div>
                                                <div class="loading-icon">
                                                    <div class="spinner" role="spinner"><div class="spinner-icon"></div></div>
                                                </div>
                                                <div class="audio-nprogress" style="width: 0%;"></div>
                                            </div>
                                        </div>
                                        <div ng-if="item.entrustType == 'text'">
                                            <!--<p class="entrust-type-p">[文本消息]</p>-->
                                            <div class="entrust-content-div">
                                                <div class="data-content">{{item.entrustContent}}</div>
                                            </div>
                                        </div>
                                        <br />
                                        <p class="dark">嘱托对象:{{item.toEntrustChildName}}&nbsp;宝宝</p>
                                        <p class="dark">嘱托于{{item.entrustTime | date:'yyyy-MM-dd HH:mm'}}</p>
                                    </div>
                                    <div class="col">
                                        <i class="ion-chevron-right assertive entrust-info-i"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="load-more-btn" style="text-align: center;" ng-show="(vm.loadMoreUnsolvedBtnStatus == false && vm.entrustStatusParams == 'unexecuted') || (vm.loadMoreSolvedStatus == false && vm.entrustStatusParams == 'execute')">
                            <p class="no-data-p">下面没有更多的嘱托了</p>
                        </div>
                        <ion-infinite-scroll immediate-check="false" on-infinite="loadMoreEntrust()" distance="1%" ng-show="vm.loadMoreUnsolvedBtnStatus"></ion-infinite-scroll>
                    </ion-scroll>
                </div>
                <div ng-show="vm.isUnsolved == false">
                    <ion-scroll direction="y" style="width: 100%;height: 100%;position: fixed;">
                        <div class="card" style="position: relative;overflow: hidden;"  ng-repeat="item in vm.solvedExhortaions track by $index" ui-sref="entrust.entrustInfo({entrustId:item.id})">
                            <div class="entrust-import-stat" ng-show="item.importantState === 'true'">重要</div>
                            <div class="item">
                                <div class="row">
                                    <div class="col col-90">
                                        <div ng-if="item.entrustType == 'audio'">
                                        <!--<p class="entrust-type-p">[音频消息]</p>-->
                                            <div class="entrust-content-div">
                                                <div class="data-content audio-content">
                                                    <!--<button ng-click="playAudio(item.entrustAudioPath,item.id)" class="ion ion-play entrust-button-play"></button>-->
                                                    <button class="ion ion-play entrust-button-play"></button>
                                                </div>
                                                <div class="loading-icon">
                                                    <div class="spinner" role="spinner"><div class="spinner-icon"></div></div>
                                                </div>
                                                <div class="audio-nprogress" style="width: 0%;"></div>
                                            </div>
                                        </div>
                                        <div ng-if="item.entrustType == 'text'">
                                        <!--<p class="entrust-type-p">[文本消息]</p>-->
                                            <div class="entrust-content-div">
                                                <div class="data-content">{{item.entrustContent}}</div>
                                            </div>
                                        </div>
                                        <br />
                                        <p class="dark">嘱托对象:{{item.toEntrustChildName}}&nbsp;宝宝</p>
                                        <p class="dark">嘱托于{{item.entrustTime | date:'yyyy-MM-dd HH:mm'}}</p>
                                    </div>
                                    <div class="col">
                                        <i class="ion-chevron-right assertive entrust-info-i"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="load-more-btn" style="text-align: center;" ng-show="(vm.loadMoreUnsolvedBtnStatus == false && vm.entrustStatusParams == 'unexecuted') || (vm.loadMoreSolvedStatus == false && vm.entrustStatusParams == 'execute')">
                            <p class="no-data-p">下面没有更多的嘱托了</p>
                        </div>
                        <ion-infinite-scroll immediate-check="false" on-infinite="loadMoreEntrust()" distance="10%" ng-if="vm.loadMoreSolvedStatus"></ion-infinite-scroll>
                    </ion-scroll>
                    <p>&nbsp;</p>
                </div>
            </div>
        </div>
    </ion-content>
</ion-view>